<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Update</title>
    <#include "/common/base.html" >
</head>
<body class="easyui-layout">
<div data-options="region:'center',fit: true">
    <table>
        <form method="post" id="updateForm">
            <tr>
                <td>名称：</td>
                <td><input type="text" id="name" name="name" maxlength="50" value="${menu.name}"></td>
            </tr>
            <tr>
                <td>链接：</td>
                <td><input type="text" id="url" name="url" value="${menu.url}"></td>
            </tr>
            <tr>
                <td>描述：</td>
                <td><input type="text" id="description" name="description" value="${menu.description}"></td>
            </tr>
            <tr>
                <td>代码：</td>
                <td><input type="text" id="code" name="code" value="${menu.code}"></td>
            </tr>
            <tr>
                <td><input type="button" id="save_btn" value="修改" onclick="save()"></td>
            </tr>
            <input type="hidden" name="id" value="${id}">
        </form>
    </table>
</div>
</body>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script>
    $(function () {
        var opt = {
            url: 'modify',
            type: 'POST',
            beforeSubmit: function(){
                $('#save_btn').attr('disabled',true);
            },
            success: function(rsp,status){
                $('#save_btn').attr('disabled',false);
                if(rsp['success']){
                    msg('修改成功', true);
                    closeReload();
                }else {
                    msg(rsp['info'],true);
                }
            }
        };
        $("#updateForm").ajaxForm(opt);
    })
    function save() {
        //验证
        var f = submitVali();
        if(f) $("#updateForm").submit();
    }
    function submitVali(){
        return true;
    }
</script>
</html>